package com.qdhhxy.controller;

import com.qdhhxy.entity.UserEntity;
import com.qdhhxy.service.IUserService;
import com.qdhhxy.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserController {
    @Autowired
    private IUserService userService;
    @RequestMapping("/insertUser")
    public String insertUser(UserEntity userEntity){
        userService.insertUser(userEntity);
        return "insert user";
    }
    @RequestMapping("/selectUserById")
    public UserEntity selectUserById(int id){
       UserEntity user= userService.selectUserById(id);
       return user;
    }

}
